/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"5236A1EA-334B-44F2-A869-A0680CC60744",variableType:4}
 */
var gCadenaLogin = null;

/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"FB498723-3A8B-45D2-8ACF-CAAA2EDEA504"}
 */
var gLocale = null;

/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"76CC1DC8-4332-4236-A6C9-0B35BF65C285",variableType:4}
 */
var gHotelLogin = null;

/**
 * @param {String} args
 *
 * @properties={typeid:24,uuid:"4C0F4F94-5C5D-4C40-B9B1-9E8B302F7F04"}
 */
function onSolutionOpenLogin(args) {
	// PARA LAS PRUEBAS EN DEVELOPER
	if (args == null)
	{
		args = '1|2|es|9999'
	}
	
	var $args = args.split('|', 4)
	gCadenaLogin 		= $args[0]
	gHotelLogin 		= $args[1]
	gLocale 			= $args[2]
	setLocale()

	var tipo_cliente 	= $args[3]
	if (tipo_cliente == '9999')
	{
		var ok = security.authenticate('hoteleria_auth','autenticar',[0])
		if (!ok)
		{
			return false
		}
	}
	return true
}

/**
 * @properties={typeid:24,uuid:"ABACE487-A02C-4F71-B0D6-4B3B9AFCC1A2"}
 */
function setLocale() {
	if (gLocale == 'es')
		var $pais = 'AR'
	else
		if (gLocale == 'pt')
			var $pais = 'BR'
		else
			var $pais = 'UK'
	i18n.setLocale(gLocale,$pais)
}
